// // Compare two different ObjectID's using the equals method

// var ObjectID = require('mongodb').ObjectID,
//   test = require('assert');
// // Create a new ObjectID
// var objectId = new ObjectID();
// // Create a new ObjectID Based on the first ObjectID
// var objectId2 = new ObjectID(objectId.id);
// // Create another ObjectID
// var objectId3 = new ObjectID();

// console.log(objectId.id === objectId2.id)
 var ObjectId = require('mongodb').ObjectID;
var MongoClient = require('mongodb').MongoClient;

MongoClient.connect('mongodb://127.0.0.1:27017/jiang',(err,db)=>{
            var res = db.collection('list').find({"_id" : ObjectId("59917a11a7de7c2734fdab12")});
            var result = [];
            res.each((err, doc) => {
                if (doc != null) {
                    result.push(doc); 
                } else {
                    db.close();
                    console.log(result);
                }
            });
        });



  